<template>
	<view class="edit">
		<robin-editor class="editor" @cancel="hideEditor" @save="saveEditor" v-model="html" :imageUploader="uploadImg"
			:muiltImage="true">
		</robin-editor>
	</view>
</template>

<script>
	import robinEditor from '../compontent/robin-editor/editor.vue'
	import {
		uniBack
	} from '@/utils/uniPromise.js'
	export default {
		data() {
			return {
				html: '',
				title:''
			}
		},
		components: {
			robinEditor
		},
		onLoad(Option){
			// console.log(Option.title)
			uni.setNavigationBarTitle({
			    title: Option.title == 'details'?'图文信息':Option.title == 'others'?'价格说明':'预定须知'
			});
			this.title = Option.title
			let page = getCurrentPages()
			this.html = page[page.length-2].$vm.common_details[Option.title]
		},
		methods: {
			uploadImg(val) {
				// console.log(val,1)
			},
			saveEditor(val) {
				// console.log(val.html)
				let page = getCurrentPages()
				page[page.length-2].$vm.getDetail({title:this.title,content:val.html})
				uniBack(1)
			},
			hideEditor() {
				uniBack(1)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.edit {
		width: 100%;
		overflow: hidden;
	}
</style>
